﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ZombieMonkeys.Vibria.Logic
{
    /// <summary>
    /// The main component of the sudoku puzzle
    /// </summary>
    public class Square
    {
        //how do we really want note to work?
        List<string> notes;

        int value; //this could also be a char, instead of int

        //this will be a string representation of the squares value
        string text;

        bool permanent;

        bool penMode;

        int row;

        int col;

        /// <summary>
        /// Default constructor
        /// </summary>
        public Square()
        {
            value = 0;
        }

        /// <summary>
        /// Method to change to stored value of a square
        /// </summary>
        /// <param name="newValue">the value to assign</param>
        public void SetValue(int newValue)
        {
            value = newValue;
            //get the text value from the value passed in
            string newText = value.ToString();

            setText(newText);
        }

        //if we are going to have this we need to decide this soon so we can design it in or out
        //this is if we want to design our sudoku to handle more than just numbers
        public void setPicture(string picFile)
        {
            setPic(picFile);
        }

        /// <summary>
        /// the ability to set a picture for a sudoku square
        /// </summary>
        /// <param name="pic">the file that represents the graphic</param>
        private void setPic(string pic)
        { 
        
        }

        private void setText(string numberText)
        {
            text = numberText;
        }

        /// <summary>
        /// Set the row that a square belongs to
        /// </summary>
        /// <param name="gridRow">the squares row</param>
        public void SetRow(int gridRow)
        {
            row = gridRow;
        }

        /// <summary>
        /// Set the Column that a square belongs to
        /// </summary>
        /// <param name="gridColumn">the squares column</param>
        public void SetColumn(int gridColumn)
        {
            col = gridColumn;
        }

        //This may have to change, let me know how you were planning on getting the notes from the gui to the data
        public int SetNote(string note)
        {
            int noteCount=0;
            noteCount = notes.Count;
            while (noteCount <= 4)
            {
                notes.Add(note);
            }
            
            return noteCount;
        }

        /// <summary>
        /// Clears out the value in the current square
        /// </summary>
        public void Clear()
        {
            text = "";
        }
    }
}
